<script setup>
import { articleGetChannelListService } from '@/api/article'
import { ref } from 'vue'
const channelList = ref([]) // 频道列表
// 定义 v-model 绑定（默认使用 modelValue 和 update:modelValue）
const selectedId = defineModel({
  type: [String, Number],
  default: ''
})
// 获取文章列表
const getChannelList = async () => {
  const res = await articleGetChannelListService()
  channelList.value = res.data.data
}
getChannelList()
</script>
<template>
  <el-select v-model="selectedId" placeholder="请选择" style="width: 200px">
    <el-option
      v-for="item in channelList"
      :key="item.id"
      :label="item.cate_name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>
